﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>

<div class="book_list">
        	<!--tab-->
        	<div class="book_list_tab">
            	<ul class="clearfix">
                	<li>借阅排行榜</li>
                    <li>收藏排行榜</li>
                </ul>
            </div>
            <!--list-->
      <%--      select lb_id,lb_bookName,lb_cover, from joy.LibraryBook a inner join joy.UserSave b on a.lb_id = b.us_lbid--%>
            <div class="book_list_main">
            	<ul>
               <% 
                    BIZ.BookOper bo = new BIZ.BookOper();
                    IList lijy = bo.jyRanking();
                    int f = 1;
                    foreach (Hashtable tb in lijy)
                    {
                        if(f==1)
                            Response.Write("<li class=\"first_li\"><em>" + f.ToString() + "</em><a href=\"/search/detail.html?id=" + (tb["lb_id"] == null ? "" : tb["lb_id"].ToString()) + "\"><img src=\"" + BIZ.StringTool.changeImgUrl((tb["lb_cover"] == null ? "" : tb["lb_cover"].ToString())) + "\" /></a></li>");
                        else
                            Response.Write("<li><b>" + f.ToString() + "</b><a href=\"/search/detail.html?id=" + (tb["lb_id"] == null ? "" : tb["lb_id"].ToString()) + "\"><img src=\"" + BIZ.StringTool.changeImgUrl((tb["lb_cover"] == null ? "" : tb["lb_cover"].ToString())) + "\" /><strong>" + (tb["lb_bookName"] == null ? "" : tb["lb_bookName"].ToString()) + "</strong></a></li>");
                        f++;
                    }
                %>
                </ul>
            	<ul>
               <% 
                    IList lisave = bo.saveRanking();
                    int j = 1;
                    foreach (Hashtable tb in lisave)
                    {
                        if(j==1)
                            Response.Write("<li class=\"first_li\"><em>" + j.ToString() + "</em><a href=\"/search/detail.html?id=" + (tb["lb_id"] == null ? "" : tb["lb_id"].ToString()) + "\"><img src=\"" + BIZ.StringTool.changeImgUrl((tb["lb_cover"] == null ? "" : tb["lb_cover"].ToString())) + "\" /></a></li>");
                        else
                            Response.Write("<li><b>" + j.ToString() + "</b><a href=\"/search/detail.html?id=" + (tb["lb_id"] == null ? "" : tb["lb_id"].ToString()) + "\"><img src=\"" + BIZ.StringTool.changeImgUrl((tb["lb_cover"] == null ? "" : tb["lb_cover"].ToString())) + "\" /><strong>" + (tb["lb_bookName"] == null ? "" : tb["lb_bookName"].ToString()) + "</strong></a></li>");
                        j++;
                    }
                %>
                </ul>
            </div>
        </div>


        <script language="javascript" type="text/javascript">
            $(function () {
                //tab切换
                $(".book_list_tab li").eq(0).addClass("select_tab");
                $(".book_list_main > ul").eq(0).show();
                $(".book_list_tab li").click(function () {
                    $(this).addClass("select_tab").siblings().removeClass("select_tab");
                    var i = $(this).index();
                    $(".book_list_main > ul").eq(i).show().siblings().hide();
                })
            });
        </script>